#ifndef PRODUCT_TEST
#define PRODUCT_TEST

/* Product Test
*************************************************************************************
*
*	Test code for testing string -> product
*
*************************************************************************************
*
*   Credits
*
*		Richard Rios
*		Aaron Solomon
*
*************************************************************************************
*/
	#include "Inventory.h"
	#include "Product.h"

	#include <iostream>

	using namespace std;
/*
*************************************************************************************/

struct ProductTest {
	static void execute() {
	/*
	*
	*   Description
	*   -----------------------
	*
	*       Attempts to convert two lines read from a file into two products.
	*
	*		Outputs error if conversion failed.
	*
	*   Takes
	*   -----------------------
	*
	*       nothing
	*
	*   Returns
	*   -----------------------
	*
	*       nothing
	*
	*/
		ifstream file;

		file.open("Invent.dat");

		if (!file.is_open()) { cout << "Couldn't open file" << endl; return; }

		char line1[40];
		char line2[40];
	
		file.getline(line1, 40);
		file.getline(line2, 40);

		cout << line1 << endl;
		cout << line2 << endl;

		file.close();

		try {
			Product product(line1);
		}
		catch (int e) {
			cout << "FAIL: " << e << endl;
			return;
		}

		try {
			Product product(line2);
		}
		catch (int e) {
			cout << "FAIL 2: " << e << endl;
			return;
		}

		cout << "SUCESS" << endl;
	} //execute
};

#endif